import java.math.BigDecimal;

/**
 * @Author DengJia
 * @Date 2021/7/29 22:07
 * @Description
 */

public class LiteralsDemo {
    public static void main(String[] args) {
        int i1 = 0x2f; // Hexadecimal（lowercase）
        System.out.println("Hexadecimal（lowercase）: 0x2f");
        System.out.println("i1: " + Integer.toBinaryString(i1) + "\n");

        int i2 = 0X2F; // Hexadecimal（uppercase）
        System.out.println("Hexadecimal（uppercase）: 0X2F");
        System.out.println("i2: " + Integer.toBinaryString(i2) + "\n");

        int i3 = 0177; // Octal（leading zero）
        System.out.println("Octal（leading zero）: 0177");
        System.out.println("i3: " + Integer.toBinaryString(i3) + '\n');

        char c = 0xffff; // max char hex value
        System.out.println("max char hex value: 0xffff");
        System.out.println("c: " + Integer.toBinaryString(c)+'\n');

        byte b = 0x7f; // max byte hex value
        System.out.println("max byte hex value: 0x7f");
        System.out.println("b: " + Integer.toBinaryString(b)+'\n');

        short s = 0x7fff; // max short hex value
        System.out.println("max short hex value； 0x7fff");
        System.out.println("s: " + Integer.toBinaryString(s));

        long n1 = 100L;
        long n2 = 100l; // but can be confusing
        long n3 = 100;

        float f1 = 1F;
        float f2 = 1f;
        float f3 = 1;

        double d1 = 1D;
        double d2 = 1d;
        double d3 = 1;
    }
}
